﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

namespace OwlLookNetCore.Services
{
    public class RuleService
    {
        public static readonly IList<string> BlackDomain = new List<string> {
            "www.17k.com", "mm.17k.com", "www.xs8.cn", "www.zongheng.com", "yunqi.qq.com", "chuangshi.qq.com",
            "book.qidian.com", "www.soduso.com", "pages.book.qq.com", "book.km.com", "www.lread.net",
            "www.0dsw.com", "www.5200xsb.com", "www.80txt.com", "www.sodu.tw", "www.shuquge.com",
            "www.shenmanhua.com", "xiaoshuo.sogou.com", "www.999wx.com", "zetianji8.com", "www.bookso.net",
            "m.23us.com", "www.qbxsw.com", "www.zhuzhudao.com", "www.shengyan.org", "www.360doc.com",
            "www.ishuo.cn", "read.qidian.com", "www.yunlaige.com", "www.qidian.com", "www.sodu888.com",
            "www.siluke.cc", "read.10086.cn", "www.pbtxt.com", "c4txt.com", "www.bokon.net", "www.sikushu.net",
            "www.is028.cn", "www.tadu.com", "www.kudu8.com", "www.bmwen.com", "www.5858xs.com", "www.yiwan.com",
            "www.x81zw.com", "www.123du.cc", "www.chashu.cc", "20xs.com", "www.haxwx.net", "www.dushiwenxue.com",
            "www.yxdown.com", "www.jingcaiyuedu.com", "www.zhetian.org", "www.xiaoshuo02.com", "www.xiaoshuo77.com",
            "www.868xh.com", "dp.changyou.com", "www.iyouman.com", "www.qq717.com", "www.yznn.com", "www.69w.cc",
            "www.doupocangqiong1.com", "www.manhuatai.com", "www.5wxs.com", "www.ggshuji.com", "www.msxf.net",
            "www.mianhuatang.la", "www.boluoxs.com", "www.lbiquge.top", "www.69shu.com", "www.qingkan520.com",
            "book.douban.com", "movie.douban.com", "www.txshuku.com", "lz.book.sohu.com", "www.3gsc.com.cn",
            "www.txtshu365.com", "www.517yuedu.com", "www.baike.com", "read.jd.com", "www.zhihu.com", "wshuyi.com",
            "www.19lou.tw", "www.chenwangbook.com", "www.aqtxt.com", "book.114la.com", "www.niepo.net",
            "me.qidian.com", "www.gengd.com", "www.77l.com", "www.geilwx.com", "www.97xiao.com", "www.anqu.com",
            "www.wuxiaxs.com", "yuedu.163.com", "b.faloo.com", "bbs.qidian.com", "jingji.qidian.com", "www.sodu.cc",
            "forum.qdmm.com", "www.qdmm.com", "game.91.com", "www.11773.com", "mt.sohu.com", "book.dajianet.com",
            "haokan.17k.com", "www.qmdsj.com", "www.jjwxc.net", "ishare.iask.sina.com.cn", "www.cmread.com",
            "www.52ranwen.net", "www.dingdianzw.com", "www.topber.com", "www.391k.com", "www.qqxzb.com",
            "www.zojpw.com", "www.pp8.com", "www.bxwx.org", "www.hrsxb.com", "www.497.com", "www.d8qu.com",
            "www.duwanjuan.com", "www.05935.com", "book.zongheng.com", "www.55x.cn", "www.freexs.cn",
            "xiaoshuo.360.cn", "www.3kw.cc", "www.gzbpi.com", "book.sina.com.cn", "www.vodtw.com", "wenda.so.com",
            "product.dangdang.com", "www.chuiyao.com", "novel.slieny.com", "www.bilibili.com", "donghua.dmzj.com",
            "www.yaojingweiba.com", "www.qb5200.com", "www.520tingshu.com", "www.567zw.com", "www.zjrxz.com",
            "v.qq.com", "blog.sina.com.cn", "www.hackhome.com", "news.fznews.com.cn", "www.jingyu.com",
            "news.so.com", "www.sodu3.com", "vipreader.qidian.com", "www.mozhua9.com", "www.iqiyi.com"
        };

        public static readonly IList<string> RecommendDomain = new List<string> {
            "www.biqugex.com", "www.x23us.com", "www.23us.la", "www.sqsxs.com", "www.nuomi9.com", "www.biquge.info",
            "www.biquge.tw", "www.qu.la", "www.ybdu.com", "www.wenxuemi.com", "www.biquge.com", "www.23us.cc", "www.xs222.com",
            "www.lewen8.com", "www.bqg5200.com", "www.vodtw.com", "www.6mao.com", "www.biquge.sh", "www.touxiang.la", "www.bxquge.com",
            "www.beidouxin.com", "www.biquge.lu", "www.263zw.com", "www.3qzone.com", "wwww.yooread.com", "www.suimeng.la",
            "www.bequge.com", "www.biquku.co", "www.xbqge.com", "www.aiquxs.com", "www.23us.com", "www.biqiuge.com",
            "www.ddbiquge.com", "www.abocms.cn", "www.a306.com", "www.liewen.cc", "www.8535.org", "www.dingdianzw.com", "www.biquge.cc",
            "www.111bz.org", "www.biqugebook.com", "www.e8zw.com", "www.xqqxs.com", "tianyibook.la", "www.lingdianksw.com", "www.qb5.tw",
            "www.quanben.com", "www.58xs.com", "www.biqukan.com", "www.yssm.org", "www.ymoxuan.com", "www.mytxt.cc",
            "www.woquge.com", "www.biquguo.com", "www.8jzw.cc", "www.biquge.tv", "www.biquge5200.com", "www.8jzw.com",
            "www.23xsw.cc", "www.miaobige.com", "www.xs.la", "www.44pq.co", "www.50zw.la", "www.33xs.com", "www.zwdu.com", "www.ttzw.com",
            "www.zanghaihuatxt.com", "www.kuxiaoshuo.com", "www.biqudu.com", "www.biqugeg.com", "www.23txt.com", "www.baquge.tw",
            "www.23qb.com", "www.lread.cc", "www.biqudao.com", "www.laidudu.com", "www.kxs7.com", "www.biquguan.com", "www.biquta.com",
            "www.xs98.com", "www.bqge.org", "www.58xs.tw", "www.187ks.com", "www.yikanxiaoshuo.com", "www.23zw.me", "www.37zw.net",
            "www.biquge.cm", "www.kanshu58.com", "www.biqumo.com", "www.mpxiaoshuo.com", "www.23wx.cm", "www.biquge.jp", "www.biqugexsw.com",
            "www.biqu6.com", "www.xiuxs.com", "www.biqule.com", "www.biquzi.com", "www.biquku.la", "www.00ksw.org", "www.bqg.cc",
            "www.biqugezw.com", "www.50331.net",
            //"www.81zw.com" gbk编码暂时注释
        };

        public static readonly IDictionary<string, ParseRule> ParseDomain = new Dictionary<string, ParseRule>
        {
            { "www.biqugex.com", new ParseRule("http://www.biqugex.com/", ".listmain", "#content", "GBK") },
            { "www.biquge.info", new ParseRule("0", ".box_con", "#content") },
            { "www.37zw.net", new ParseRule("0", ".box_con", "#content") },
            { "www.biquku.la", new ParseRule("0", ".box_con", "#content") },
            { "www.biquge.sh", new ParseRule("1", ".box_con", "#content") },
            { "www.biquge.co", new ParseRule("0", ".box_con", "#content") },
            { "www.00ksw.org", new ParseRule("0", ".ml_list", "#articlecontent") },
            { "www.bqge.org", new ParseRule("http://www.bqge.org/", ".box_con", "#content") },
            { "www.biquzi.com", new ParseRule("http://www.biquzi.com/", ".box_con", "#content") },
            { "www.bqg.cc", new ParseRule("http://www.bqg.cc/", ".box_con", "#content") },
            { "www.biquge.jp", new ParseRule("0", "#list", "#content") },
            { "www.vipzw.com", new ParseRule("http://www.vipzw.com/", ".box_con", "#content") },
            { "www.biquge5200.com", new ParseRule("1", ".box_con", "#content") },
            { "www.zanghaihuatxt.com", new ParseRule("http://www.zanghaihuatxt.com/", ".listmain", "#content") },
            { "www.xiuxs.com", new ParseRule("http://www.xiuxs.com/", ".box_con", "#content") },
            { "www.1biquge.com", new ParseRule("http://www.1biquge.com/", ".box_con", "#content") },
            { "www.xiaoshuowan.com", new ParseRule("http://www.xiaoshuowan.com/", ".box_con", "#content") },
            { "www.biqugela.com", new ParseRule("http://www.biqugela.com/", ".box_con", "#content") },
            { "www.biqu6.com", new ParseRule("http://www.biqu6.com/", ".box_con", "#content") },
            { "www.sqsxs.com", new ParseRule("0", ".box_con", "#content") },
            { "www.biquge.tv", new ParseRule("http://www.biquge.tv/", ".box_con", "#content") },
            { "www.biquta.com", new ParseRule("https://www.biquta.com/", ".box_con", "#content") },
            { "www.biquge.cm", new ParseRule("http://www.biquge.cm/", ".box_con", "#content") },
            { "www.23qb.com", new ParseRule("https://www.23qb.com/", "#chapterList", "#TextContent") },
            { "www.biqugexsw.com", new ParseRule("http://www.biqugexsw.com/", ".box_con", "#content") },
            { "www.kuxiaoshuo.com", new ParseRule("1", ".box_con", "#content") },
            { "www.laidudu.com", new ParseRule("http://www.laidudu.com/", ".listmain", "#content") },
            { "www.kanshu58.com", new ParseRule("0", ".chapters", "#content") },
            { "www.mpxiaoshuo.com", new ParseRule("0", ".mulu_list", "#htmlContent") },
            { "www.23zw.me", new ParseRule("0", "#chapter_list", "#text_area") },
            { "www.187ks.com", new ParseRule("0", ".box_con", "#content") },
            { "www.58xs.tw", new ParseRule("http://www.58xs.tw/", ".box_con", "#content") },
            { "www.biquguan.com", new ParseRule("http://www.biquguan.com/", ".box_con", "#content") },
            { "www.xs98.com", new ParseRule("0", ".box_con", "#content") },
            { "www.kxs7.com", new ParseRule("http://www.kxs7.com/", ".box_con", "#content") },
            { "www.biqudao.com", new ParseRule("http://www.biqudao.com/", ".box_con", "#content") },
            { "www.nuomi9.com", new ParseRule("0", ".box_con", "#content") },
            { "book.sfacg.com", new ParseRule("http://book.sfacg.com/", ".story-catalog", "p") },
            { "www.7kshu.com", new ParseRule("0", "#chapterlist", "#content") },
            { "www.lread.cc", new ParseRule("http://www.lread.cc/", ".box_con", "#booktext") },
            { "www.baquge.tw", new ParseRule("http://www.baquge.tw/", ".box_con", "#content") },
            { "www.biqudu.com", new ParseRule("http://www.biqudu.com/", ".box_con", "#content") },
            { "www.biqugeg.com", new ParseRule("http://www.biqugeg.com/", ".box_con", "#content") },
            { "www.23txt.com", new ParseRule("http://www.23txt.com/", ".box_con", "#content") },
            { "www.ttzw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.zwdu.com", new ParseRule("http://www.zwdu.com/", ".box_con", "#content") },
            { "www.33xs.com", new ParseRule("http://www.33xs.com/", ".box_con", "#content") },
            { "www.50zw.la", new ParseRule("0", ".chapterlist", "#htmlContent") },
            { "www.44pq.co", new ParseRule("0", ".chapterlist", "#BookText") },
            { "www.wddsnxn.org", new ParseRule("1", ".booklist", "#BookText") },
            { "mianzhuan.wddsnxn.org", new ParseRule("1", ".booklist", "#BookText") },
            { "www.a306.com", new ParseRule("http://www.a306.com/", ".box_con", "#content") },
            { "www.xs52.com", new ParseRule("0", "#chapter_list", "#text_c") },
            { "www.xs.la", new ParseRule("http://www.xs.la/", ".box_con", "#content") },
            { "www.23xsw.cc", new ParseRule("http://www.23xsw.cc/", ".listmain", "#content") },
            { "www.8jzw.com", new ParseRule("http://www.8jzw.com/", ".box_con", "#content") },
            { "www.biquguo.com", new ParseRule("0", ".box_con", "#content") },
            { "www.woquge.com", new ParseRule("1", ".box_con", "#content") },
            { "www.zhonghuawuxia.com", new ParseRule("1", ".list","#content") },
            { "www.mytxt.cc", new ParseRule("http://www.mytxt.cc/", ".story_list_m62topxs", ".detail_con_m62topxs") },
            { "www.136txt.com", new ParseRule("1", ".directory_con", "#chapterContent") },
            { "www.xs74.com", new ParseRule("1", ".box_con", "#content") },
            { "www.yssm.org", new ParseRule("0", ".chapterlist", "#content") },
            { "www.luoxia.com", new ParseRule("1", ".book-list", "p") },
            { "www.sbkk88.com", new ParseRule("http://www.sbkk88.com/", ".leftList", "#f_article") },
            { "www.dxsxs.com", new ParseRule("http://www.dxsxs.com/", "#yuedu", ".zw") },
            { "www.wenku8.com", new ParseRule("0", ".css","#content") },
            { "www.xqingdou.net", new ParseRule("http://www.xqingdou.net/", ".dirconone", "#chapter_content") },
            { "www.zuowe.com", new ParseRule("http://www.zuowe.com/", ".book_list", "#htmlContent") },
            { "www.wuyanxia.net", new ParseRule("http://www.wuyanxia.net/", ".zjlist4", "#htmlContent") },
            { "www.50331.net", new ParseRule("http://www.50331.net/", "#main", ".zhang-txt-nei-rong") },
            { "www.wenxuemi.com", new ParseRule("http://www.wenxuemi.com/", ".box_con", "#content") },
            { "www.xs222.com", new ParseRule("http://www.xs222.com/", ".box_con", "#content") },
            { "www.lewen8.com", new ParseRule("http://www.lewen8.com/", "#chapterlist", "#content") },
            { "www.5ccc.net", new ParseRule("0", ".acss", "#content") },
            { "www.suimeng.la", new ParseRule("0", ".acss", "#ccontent") },
            { "www.bqg5200.com", new ParseRule("http://www.bqg5200.com/", "#readerlist","#content") },
            { "www.vodtw.com", new ParseRule("0", ".insert_list", ".contentbox") },
            { "www.6mao.com", new ParseRule("http://www.6mao.com/", ".liebiao_bottom", "#neirong", "GBK") },
            { "www.touxiang.la", new ParseRule("http://www.touxiang.la/", ".listmain","#content") },
            { "www.7kankan.com", new ParseRule("0", ".uclist","#content") },
            { "www.biqugetw.com", new ParseRule("http://www.biqugetw.com/", ".box_con", "#content") },
            { "gdbzkz.com", new ParseRule("1", ".mulu", ".content-body") },
            { "www.gdbzkz.com", new ParseRule("1", ".mulu", ".content-body") },
            { "www.freexs.cn", new ParseRule("0", ".readout", ".shuneirong") },
            { "www.bxquge.com", new ParseRule("0", ".box_con", "#content") },
            { "www.beidouxin.com", new ParseRule("0", ".box_con", "#content") },
            { "www.3qzone.com", new ParseRule("0", ".box_con", "#content") },
            { "www.97xs.net", new ParseRule("1", ".box", "#htmlContent") },
            { "www.7dsw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.263zw.com", new ParseRule("1", ".chapter", "#chapterContent") },
            { "www.biquge5.com", new ParseRule("1", "#chapterslist","#content") },
            { "www.yooread.com", new ParseRule("http://www.yooread.com", "#chapterList", "p") },
            { "www.xs82.com", new ParseRule("0", ".chapterlist", "#content") },
            { "www.kanshuhai.com", new ParseRule("0", "#book", "#content") },
            { "www.bequge.com", new ParseRule("0", ".box_con", "#content") },
            { "www.biquku.co", new ParseRule("0", ".box_con", "#content") },
            { "www.xbqge.com", new ParseRule("0", ".box_con", "#content") },
            { "www.aiquxs.com", new ParseRule("0", "#list", "#booktext") },
            { "www.ttshu.com", new ParseRule("http://www.ttshu.com", ".border","#content") },
            { "www.23us.com", new ParseRule("0", "#at", "#contents") },
            { "www.x23us.com", new ParseRule("0", "#at", "#contents", "GBK") },
            { "www.23wx.cc", new ParseRule("0", ".box_con", "#content") },
            { "www.23wx.cm", new ParseRule("0", ".book_list", "#htmlContent") },
            { "www.ddbiquge.com", new ParseRule("http://www.ddbiquge.com", ".listmain","#content") },
            { "www.abocms.cn", new ParseRule("http://www.abocms.cn", ".box_con", "#content") },
            { "www.liewen.cc", new ParseRule("http://www.liewen.cc", ".box_con", "#content") },
            { "www.heiyange.com", new ParseRule("http://www.heiyange.com", ".box_con", "#content") },
            { "www.8535.org", new ParseRule("0", ".booklist", ".txtc") },
            { "www.dingdianzw.com", new ParseRule("http://www.dingdianzw.com", "#bgdiv","#content") },
            { "www.biquge.cc", new ParseRule("0", ".box_con", "#content") },
            { "www.lewenxiaoshuo.com", new ParseRule("1", ".box_con", "#content") },
            { "www.111bz.org", new ParseRule("http://www.111bz.org", ".box_con", "#content") },
            { "www.biqugebook.com", new ParseRule("http://www.biqugebook.com", ".box_con", "#content") },
            { "www.e8zw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.xqqxs.com", new ParseRule("0", ".box_con", ".content") },
            { "www.139book.com", new ParseRule("http://www.139book.com", ".list_box", ".box_box") },
            { "www.jcdf99.com", new ParseRule("0", ".list_box","#content") },
            { "www.tianzeba.com", new ParseRule("http://www.tianzeba.com", ".chapterlist", "#BookText") },
            { "www.kanshuwangzhan.com", new ParseRule("0", "#chapterlist", "#booktext") },
            { "tianyibook.la", new ParseRule("http://tianyibook.la", ".chapterlist", "#BookText") },
            { "www.quanben.net", new ParseRule("http://www.quanben.net", ".chapterlist", "#BookText") },
            { "www.lingdianksw.com", new ParseRule("0", ".acss", "#ccontent") },
            { "www.qb5.tw", new ParseRule("http://www.qb5.tw", ".zjbox","#content") },
            { "www.ybdu.com", new ParseRule("0", ".mulu_list", "#htmlContent") },
            { "www.quanben.com", new ParseRule("0", ".mulu_list", "#htmlContent") },
            { "www.fhxs.com", new ParseRule("1", ".box_con", "#content") },
            { "www.biquge.biz", new ParseRule("http://www.biquge.biz", ".box_con", "#content") },
            { "www.58xs.com", new ParseRule("http://www.58xs.com", ".box_con", "#content") },
            { "www.biqukan.com", new ParseRule("http://www.biqukan.com", ".listmain","#content") },
            { "www.shuyuelou.com", new ParseRule("http://www.shuyuelou.com", ".box_con", "#content") },
            { "www.mangg.com", new ParseRule("http://www.mangg.com", ".box_con", "#content") },
            { "www.50zw.com", new ParseRule("0", ".chapterlist", "#htmlContent") },
            { "www.lingdiankanshu.co", new ParseRule("0", ".box_con", "#content") },
            { "www.biqiku.com", new ParseRule("http://www.biqiku.com", ".box_con", "#content") },
            { "www.duilianku.com", new ParseRule("http://www.duilianku.com", "#list", ".chapter") },
            { "www.5xiaxiaoshuo.com", new ParseRule("http://www.5xiaxiaoshuo.com", ".art_listmain_main", "#content") },
            { "www.81xsw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.wxguan.com", new ParseRule("http://www.wxguan.com", ".listmain", "#content") },
            { "www.qb5200.tw", new ParseRule("http://www.qb5200.tw", ".listmain", "#content") },
            { "www.fox2008.cn", new ParseRule("http://www.fox2008.cn", ".book", "#chapterContent") },
            { "www.22zw.com", new ParseRule("0", ".acss","#content") },
            { "www.k6uk.com", new ParseRule("0", ".acss","#content") },
            { "www.126shu.com", new ParseRule("http://www.126shu.com", "#list", "#content") },
            { "www.kooxs.com", new ParseRule("0", ".list", "#content") },
            { "www.shubaotxt.com", new ParseRule("0", ".list","#content") },
            { "www.muyuge.com", new ParseRule("1", "#xslist", "#content") },
            { "www.biqu.la", new ParseRule("0", ".book_list", "#htmlContent") },
            { "shushu.com.cn", new ParseRule("http://shushu.com.cn", "#dirsort01", "#content") },
            { "www.shuhai.com", new ParseRule("0", ".box_chap", "#readcon") },
            { "www.37yue.com", new ParseRule("0", ".list-chapter", ".chapter") },
            { "www.35zw.com", new ParseRule("0", ".book_list", "#htmlContent") },
            { "www.xinshu.in", new ParseRule("http://www.xinshu.in", ".list_box", ".box_box") },
            { "www.lwxs520.com", new ParseRule("0", ".dccss","#content") },
            { "www.lwxs.la", new ParseRule("http://www.lwxs.la", "#defaulthtml4","#content") },
            { "www.biqule.com", new ParseRule("0", ".box_con", "#content") },
            { "www.33yq.com", new ParseRule("1", ".box_con", ".zhangjieTXT") },
            { "www.dishuge.com", new ParseRule("1", ".update", "p") },
            { "www.qu.la", new ParseRule("0", ".box_con", "#content") },
            { "www.shuge.net", new ParseRule("http://www.shuge.net", ".box_con", "#content") },
            { "www.daomengren.com", new ParseRule("http://www.daomengren.com", ".box_con", "#content") },
            { "www.81zw.net", new ParseRule("http://www.81zw.net", ".box_con", "#content") },
            { "www.09xs.com", new ParseRule("0", ".box_con", "#content") },
            { "www.fhxiaoshuo.com", new ParseRule("1", ".box_con", ".zhangjieTXT") },
            { "www.yikanxiaoshuo.com", new ParseRule("http://www.yikanxiaoshuo.com", ".box_con", "#content") },
            { "www.1xiaoshuo.com", new ParseRule("http://www.1xiaoshuo.com", ".box_con", "#content") },
            { "www.kanshu.la", new ParseRule("http://www.kanshu.la", ".box_con", "#content") },
            { "www.kbiquge.com", new ParseRule("http://www.kbiquge.com", ".box_con", "#content") },
            { "www.00ksw.net", new ParseRule("0", ".box_con", "#content") },
            { "www.booktxt.net", new ParseRule("http://www.booktxt.net", ".box_con", "#content") },
            { "wanmeishijiexiaoshuo.org", new ParseRule("1", ".bg", ".content") },
            { "www.sosoxiaoshuo.cc", new ParseRule("http://www.sosoxiaoshuo.cc", ".box_con", "#content") },
            { "www.ciluke.com", new ParseRule("0", "#list","#content") },
            { "www.81zw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.cilook.net", new ParseRule("0", "#cl_content","#content") },
            { "www.baoliny.com", new ParseRule("1", ".readerListShow","#content") },
            { "www.biquge.tw", new ParseRule("http://www.biquge.tw", ".box_con", "#content") },
            { "www.7788xs.net", new ParseRule("http://www.7788xs.net", ".box_con", "#content") },
            { "www.06sy.com", new ParseRule("http://www.06sy.com", ".box_con", "#content") },
            { "www.biqumo.com", new ParseRule("http://www.biqumo.com", ".box_con", "#content") },
            { "www.kanshuzhe.com", new ParseRule("http://www.kanshuzhe.com", ".box_con", "#content") },
            { "www.biqiuge.com", new ParseRule("0", ".box_con", "#content") },
            { "www.lwxs.com", new ParseRule("0", ".box_con", "#TXT") },
            { "www.biqugezw.com", new ParseRule("http://www.biqugezw.com", ".box_con", "#content") },
            { "www.biquge.com.tw", new ParseRule("http://www.biquge.com.tw", ".box_con", "#content") },
            { "www.shuqizw.com", new ParseRule("http://www.shuqizw.com", ".article_texttitleb", "#book_text") },
            { "read.ixdzs.com", new ParseRule("0", ".catalog", ".content") },
            { "www.shumilou.net", new ParseRule("0", ".chapterlist", "#BookText") },
            { "www.8shuw.com", new ParseRule("1", ".chapterlist", "#readtext") },
            { "www.heiyan.la", new ParseRule("0", ".box_con", "#content") },
            { "www.bbsa5.com", new ParseRule("1", ".panel", ".content-body") },
            { "www.tycqxs.com", new ParseRule("http://www.tycqxs.com", ".box_con", "#content") },
            { "www.miaobige.com", new ParseRule("0", "#readerlists", "#content") },
            { "www.dashubao.net", new ParseRule("0", ".ml_main", ".yd_text2") },
            { "www.23zw.com", new ParseRule("0", "#chapter_list", "#text_area") },
            { "www.23us.la", new ParseRule("http://www.23us.la", ".inner","#content") },
            { "www.2952.cc", new ParseRule("0", ".inner", "#content") },
            { "www.23us.cc", new ParseRule("0", ".inner", "#content") },
            { "www.13xs.com", new ParseRule("0", ".box_con", "#booktext") },
            { "www.tsxsw.com", new ParseRule("0", ".bdsub", "#contents") },
            { "www.ymoxuan.com", new ParseRule("1", ".mulu", "#content") },
            { "zetianjiba.net", new ParseRule("1", ".bg", ".content") },
            { "www.37zw.com", new ParseRule("0", ".box_con", "#content") },
            { "www.555zw.com", new ParseRule("0", ".dir", "#content") },
            { "www.jueshitangmen.info", new ParseRule("1", ".bg", ".content") },
            { "www.bxwx9.org", new ParseRule("0", ".TabCss", "#content") },
            { "www.xxbiquge.com", new ParseRule("http://www.xxbiquge.com", ".box_con", "#content") },
            { "www.fs23.com", new ParseRule("http://www.fs23.com", ".box_con", "#content") },
            { "www.longtengx.com", new ParseRule("http://www.longtengx.com", ".box_con", "#content") },
            { "www.lingyu.org", new ParseRule("http://www.lingyu.org", ".mt10", "#htmlContent") },
            { "www.aszw8.com", new ParseRule("0", "#at", "#contents") },
            { "www.23us.so", new ParseRule("1", "#at", "#contents") },
            { "www.biquge.lu", new ParseRule("http://www.biquge.lu", ".listmain", "#content") },
            { "www.3zm.net", new ParseRule("http://www.3zm.net", ".listmain", "#content") },
            { "www.biquge.com", new ParseRule("http://www.biquge.com", ".box_con", "#content") },
            { "www.kanshuzhong.com", new ParseRule("0", ".bookcontent", ".textcontent") },
            { "www.siluke.tw", new ParseRule("http://www.siluke.tw", ".box_con", "#content") },
        };

        // 针对某些网站检索出来的地址和真正的目录地址不一样从而进行替换
        public static readonly IDictionary<string, ReplaceUrl> ReplaceDomain = new Dictionary<string, ReplaceUrl>
        {
            { "www.miaobige.com", new ReplaceUrl("miaobige.com/book/", "miaobige.com/read/") },
            { "www.5ccc.net", new ReplaceUrl("5ccc.net/wksz_info/", "5ccc.net/xiaoshuo/") },
            { "www.7kankan.com", new ReplaceUrl("7kankan.com/files/article/info/", "7kankan.com/files/article/html/") },
            { "www.xqingdou.net", new ReplaceUrl("xqingdou.net/book_", "xqingdou.net/chapter_") },
            { "www.wuyanxia.net", new ReplaceUrl("wuyanxia.net/book/", "wuyanxia.net/read/") },
            { "www.263zw.com", new ReplaceUrl("263zw.com/402770/", "263zw.com/402770/list/") },
        };
    }

    public struct ParseRule
    {
        // None = -1,     // 不解析，跳转到原本网页
        // ConcatUrl = 0, // 表示章节网页需要当前页面url拼接
        // NoConcat = 1,  // 表示章节链接使用本身自带的链接，不用拼接
        // Host,  // 用域名进行拼接
        public string ParseUrlType { get; set; }
        public string ChapterSelector { get; set; }
        public string ContentSelector { get; set; }
        public string Encoding { get; set; }

        public ParseRule(string parseUrlType, string chapterSelector, string contentSelector, string encoding = "UTF8")
        {
            ParseUrlType = parseUrlType;
            ChapterSelector = chapterSelector;
            ContentSelector = contentSelector;
            Encoding = encoding;
        }
    }

    public struct ReplaceUrl
    {
        public string OldUrl { get; set; }
        public string NewUrl { get; set; }

        public ReplaceUrl(string oldUrl, string newUrl)
        {
            OldUrl = oldUrl;
            NewUrl = newUrl;
        }
    }
}
